<template>
	<ul class="con">
		<li v-for="(item,index) in initData" :key='index' :style='{borderColor: colorVal[index]}'>
			<div class="title">{{ item.title }}</div>
			<div class="price">{{ item.price | filterPrice }}</div>
		</li>
	</ul>
</template>
<script>

import { getAccount } from '../../../config/getData'

export default {
	data(){
		return {
			initData:[
				{ title: '资产钱包',price: '0.00'},
				{ title: '购物钱包',price: '0.00'},
				{ title: '释放钱包',price: '0.00'},
				{ title: '智能钱包',price: '0.00'},
				{ title: '算力钱包',price: '0.00'},
				{ title: '交易钱包',price: '0.00'},
				{ title: '冻结钱包',price: '0.00'},
				{ title: '左区业绩',price: '0.00'},
				{ title: '右区业绩',price: '0.00'},
				{ title: '总业绩',price: '0.00'},
			],
			colorVal:['#e8a315','#01a2ff','#ff2ffd','#ed6746','#ed6746','#ed6746','#89d000','#605cf5','#aebb1f','#01a2ff']
		}
	},
	filters:{
		filterPrice(str){
			str = parseFloat(str).toFixed(2)
			return '¥ ' + str
		}
	},
	created(){
		getAccount().then( res => {
			this.initData[0]['price'] = res.data.price || '0'
			this.initData[1]['price'] = res.data.gwprice || '0'
			this.initData[2]['price'] = res.data.sfprice || '0'
			this.initData[3]['price'] = res.data.znprice || '0'
			this.initData[4]['price'] = res.data.slprice || '0'
			this.initData[5]['price'] = res.data.jyprice || '0'
			this.initData[6]['price'] = res.data.djprice || '0'
			this.initData[7]['price'] = res.data.left_yeji || '0'
			this.initData[8]['price'] = res.data.right_yeji || '0'
			this.initData[9]['price'] = res.data.z_yeji || '0'
		})
	}
}
</script>

<style lang="scss" scoped>
.con{display: flex;flex-wrap: wrap;
	li{width:46%;margin:7px 2%;background-color: white;box-sizing: border-box;padding:15px;border-top:2px solid #01a2ff;border-radius:4px;
	box-shadow:0 2px 4px rgba(0,0,0,.05);
		.title{font-size:14px;}
		.price{font-size: 18px;margin-top:15px;}
	}
}
</style>

